<div class="modal-body">
  <div>
    <h2>Interpret Commands as Jinja2 Template</h2>
    <p>
      Select the checkbox to interpret the <b>Commands</b> text as a
      <a href="https://jinja.palletsprojects.com/en/3.1.x/">Jinja2</a>
      template. The output of the rendered template is used as the list of commands for
      execution. A common use case is looping over values to generate a command per
      value.
    </p>
  </div>
  <div>
    <h2>Example: Execute command for each interface</h2>
    <div>
      <p>
        The following code issues a "show interface" command for each interface of
        interest:
      </p>
      <pre>
{% raw %}{% for intf in get_var("interfaces", device=device.name) -%}
 show interface {{ intf }}
{% endfor %}{% endraw %}</pre
      >
      <p>
        Note the minus sign on the closing Jinja2 tag <code>-%></code> with the for
        loop. This prevents Jinja2 from generating unwanted blank lines. See
        <a
          href="https://jinja.palletsprojects.com/en/3.0.x/templates/#whitespace-control"
          >whitespace control</a
        >.
      </p>
    </div>
  </div>
</div>
